<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>门诊历史</title>
</head>
<body>
<style>
    .btn_menu {
        background-image: linear-gradient(to right, #b8bcc4 0%, #757f9a 100%, #d7dde8 100%);
        text-align: center;
        text-transform: uppercase;
        transition: 0.5s;
        background-size: 200% auto;
        color: white;
        border-radius: 10px;
        border: white;
    }

    .btn_menu:hover {
        background-position: right center; /* change the direction of the change here */
        color: #fff;
        text-decoration: none;
        border: solid 1px black;
    }

    .btn_menu:active {
        transform: scale(0.9);
    }

    body {
        background-color: #7291B5;
        font-family: Arial, sans-serif;
        margin: 0px;
        padding: 0px;
    }

    div {
        border-radius: 3px;
        min-height: 18px;
    }

    input {
        font-size: 12px;
        font-family: 'Microsoft YaHei', '微软雅黑', MicrosoftJhengHei, '华文细黑', STHeiti, MingLiu;
        border: rgb(235, 235, 235) 1px solid;
        border-radius: 3px;
        padding: 5px 8px;
        outline: 0;
    }

    .div_total {
        background:linear-gradient(to top right, #ffffff,#EAEDEEFF);
        box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2);
        height: 854px;
        width: 1473px;
        position: absolute;
        margin-top: 20px;
        margin-left: 20px;
    }

    .div_top {
        background:linear-gradient(to top right, #ffffff,#EAEDEEFF);
        box-shadow: 0px 0px 10px 0px rgb(142, 144, 141);
        height: 106px;
        position: relative;
        margin: 10px
    }

    .div_img {
        height: 95px;
        float: none;
        width: 147px;
        position: relative;
        left: 10px;
        bottom: 96px;
        margin: 5px 0 5px 0;
    }

    .div_main {
        position: relative;
        top: 2px;
        height: 700px;
        margin: 22px auto 22px auto;
    }

    .div_main_left {
        background:linear-gradient(to top right, #ffffff,#EAEDEEFF);
        box-shadow: 0px 0px 10px 0px rgb(142, 144, 141);
        margin: 10px 10px 10px 10px;
        position: relative;
        width: 147px;
        height: 678px;
    }

    .div_main_right {
        background:linear-gradient(to top right, #ffffff,#EAEDEEFF);
        box-shadow: 0px 0px 10px 0px rgb(142, 144, 141);
        margin: 0px 10px 10px 10px;
        position: absolute;
        left: 168px;
        top: 0px;
        width: 1282px;
        height: 678px;
    }

    .img {
        height: 94px;
        width: 117px;
        position: relative;
        left: 14px;
        margin: auto auto auto auto;
        background-size: cover;
        background-attachment: local;
        background-origin: border-box;
    }

    .tittle {
        position: relative;
        color: rgba(0, 0, 0, 1);
        font-style: normal;
        font-size: 27px;
        text-shadow: 0 0 0 rgba(0, 0, 0);
        box-shadow: 0 0 0 0 rgba(31, 31, 31);
        opacity: 1;
        transform: translate(0, 19px);
        border: rgba(31, 31, 31, 1) solid 1px;
        text-align: center;
        letter-spacing: 5px;
    }

    .form_a {
        position: relative;
        top: 10px;
        left: 10px;
        bottom: 10px;
        right: 10px;
        width: 1240px;
        margin: 10px 10px 10px 10px;
        cursor: pointer;
        height: 650px;
    }

    .div_name {
        position: relative;
        margin: 10px 10px 10px 10px;
        height: 50px;
    }

    .div_age {
        margin: 10px 10px 10px 10px;
        position: relative;
        height: 50px;
    }

    .div_sexy {
        margin: 10px 10px 10px 10px;
        position: relative;
        height: 50px;
    }

    .div_symptom {
        margin: 10px 10px 10px 10px;
        position: relative;
        height: 100px;
    }

    .div_diagnose {
        margin: 10px 10px 10px 10px;
        position: relative;
        height: 100px;
    }

    .div_treat {
        position: relative;
        margin: 10px 10px 10px 10px;
        height: 180px;
    }

    .txt_name {
        margin: 0 10px 10px 25px;
        color: rgba(0, 0, 0, 1);
        font-style: normal;
        font-size: 25px;
        font-weight: bolder;
        cursor: pointer;
        position: relative;
        top: 10px;
    }

    .name {
        border: rgba(0, 0, 0, 1) solid 1px;
        margin: 0 10px 10px 0;
        position: relative;
        height: 24px;
        width: 300px;
        font-style: italic;
        font-weight: normal;
        cursor: text;
        color: rgba(0, 0, 0, 1);
        font-size: 25px;
        top: 10px;
    }

    .age {
        border: rgba(0, 0, 0, 1) solid 1px;
        margin: 0 10px 10px 0;
        width: 300px;
        height: 24px;
        position: relative;
        top: 10px;
        color: rgba(0, 0, 0, 1);
        font-size: 25px;
        font-weight: normal;
        cursor: text;
        font-style: italic;
    }

    .txt_age {
        margin: 0 10px 10px 25px;
        position: relative;
        top: 10px;
        color: rgba(0, 0, 0, 1);
        font-style: normal;
        font-size: 25px;
        font-weight: bolder;
        cursor: pointer;
    }

    .sexy {
        margin: 0 10px 10px 0;
        position: relative;
        top: 10px;
        color: rgba(0, 0, 0, 1);
        font-style: normal;
        font-size: 25px;
        border: rgba(0, 0, 0, 1) solid 1px;
        font-weight: normal;
        cursor: pointer;
        height: 32px;
        width: 60px;
        text-align: center;
    }

    .txt_sexy {
        margin: 0 10px 10px 25px;
        position: relative;
        top: 10px;
        color: rgba(0, 0, 0, 1);
        font-style: normal;
        font-size: 25px;
        font-weight: bolder;
        text-align: center;
        cursor: pointer;
    }

    .symptom {
        border: rgba(0, 0, 0, 1) solid 1px;
        margin: 0 10px 10px 0;
        position: relative;
        top: 10px;
        width: 500px;
        height: 70px;
        cursor: text;
        color: rgba(0, 0, 0, 1);
        font-size: 20px;
        font-style: italic;
        font-weight: normal;
    }

    .txt_symptom {
        margin: 0 10px 10px 25px;
        position: relative;
        color: rgba(0, 0, 0, 1);
        font-style: normal;
        font-size: 25px;
        font-weight: bolder;
        cursor: pointer;
        bottom: 53px;
    }

    .diagnosis {
        border: rgba(0, 0, 0, 1) solid 1px;
        margin: 0 10px 10px 0;
        width: 500px;
        height: 70px;
        position: relative;
        top: 10px;
        color: rgba(0, 0, 0, 1);
        font-style: italic;
        font-size: 20px;
        cursor: text;
    }

    .txt_diagnosis {
        margin: 0 10px 10px 25px;
        position: relative;
        bottom: 53px;
        font-style: normal;
        color: rgba(0, 0, 0, 1);
        font-size: 25px;
        font-weight: bolder;
        cursor: pointer;
    }

    .treat {
        margin: 0 auto 10px 0;
        position: relative;
        top: 10px;
        border: rgba(0, 0, 0, 1) solid 1px;
        height: 150px;
        color: rgba(0, 0, 0, 1);
        font-style: italic;
        font-size: 20px;
        cursor: text;
        font-weight: normal;
        width: 1070px;
    }

    .txt_treat {
        margin: 0 10px 10px 25px;
        position: relative;
        bottom: 134px;
        font-size: 25px;
        color: rgba(0, 0, 0, 1);
        font-weight: bolder;
        cursor: pointer;
    }

    .btn_menu {
        position: relative;
        width: 140px;
        height: 95px;
        bottom: 0px;
        color: rgba(0, 0, 0, 1);
        font-size: 32px;
        font-weight: bolder;
        text-align: center;
        text-decoration: underline;
        cursor: pointer;
    }

    .div_btn {
        position: relative;
        left: 179px;
        top: 5px;
        margin: 5px 0 0 5px;
        height: 95px;
        width: 1270px;
    }

    .div_user {
        float: right;
        position: relative;
        margin: 10px 10px 10px 10px;
        width: 414px;
        height: 70px;
        top: 2px;
        cursor: pointer;
    }

    .user {
        color: rgba(0, 0, 0, 1);
        font-style: normal;
        font-size: 25px;
        text-align: center;
        cursor: pointer;
        position: relative;
        top: 20px;
    }

    a {
        color: rgba(0, 0, 0, 1);
        font-style: normal;
        font-size: 15px;
        text-align: center;
        cursor: pointer;
        position: relative;
        top: 20px;
        left: 10px;
    }

    .patient_list {
        position: relative;
        overflow-y: auto;
        height: 462px;
    }

    .patient_list div {
        text-align: center;
        font-size: 20px;
    }

    #search_name {
        position: relative;
        width: 130px;
        border: solid 1px black;
        border-radius: 3px;
    }

    ul li {
        list-style-type: none;
        font-size: 20px;
    }

    #search_name_btn {
        position: absolute;
        width: 148px;
        border: solid 1px black;
        font-size: 15px;
        background-image: linear-gradient(to right, #b8bcc4 0%, #757f9a 100%, #d7dde8 100%);
        text-transform: uppercase;
        transition: 0.5s;
        background-size: 200% auto;
        color: #000000;
        border-radius: 3px;
        border: black;
    }

    #search_name_btn:hover {
        background-position: right center; /* change the direction of the change here */
        color: #fff;
        text-decoration: none;
        border: solid 1px black;
    }

    #search_name_btn:active {
        transform: scale(0.9);
    }

    .medicalRecord-dateTime {
        border: solid 1px black;
        position: absolute;
        overflow-y: auto;
        top: 60px;
        width: 200px;
        height: 617px;
    }
    .medicalRecord-dateTime li{
        text-align: center;
        font-size: 25px;
    }

    .medicalRecord-content {
        border: solid 1px black;
        position: absolute;
        top: 60px;
        width: 1076px;
        height: 617px;
        left: 205px;
        overflow-y: auto;
    }

    .patient_information {

        position: absolute;
        width: 450px;
        height: 55px;
        left: 830px;
    }

    .patient_information_a {
        position: relative;
        top: 10px;
        font-size: 20px;
    }

    #btn_print {
        position: absolute;
        left: 375px;
        width: 70px;
        height: 38px;
        font-size: 15px;
        border: solid 1px black;
        background-image: linear-gradient(to right, #b8bcc4 0%, #757f9a 100%, #d7dde8 100%);
        text-transform: uppercase;
        transition: 0.5s;
        background-size: 200% auto;
        color: #000000;
        border-radius: 3px;
        border: black;
        cursor: pointer;
    }

    #btn_print:hover {
        background-position: right center; /* change the direction of the change here */
        color: #fff;
        text-decoration: none;
        border: solid 1px black;
    }

    #btn_print:active {
        transform: scale(0.9);
    }
    .whether_diagnosis_done{
        position: absolute;
        display: flex;

        width: 147px;
    }
    .whether-diagnostic{
        flex: 1;
        border: solid 1px;
        font-size: 15px;
        background-image: linear-gradient(to right, #b8bcc4 0%, #757f9a 100%, #d7dde8 100%);
        text-transform: uppercase;
        transition: 0.5s;
        background-size: 200% auto;
        color: #000000;
        border-radius: 3px;
    }
    .whether-diagnostic:hover{
        background-position: right center; /* change the direction of the change here */
        color: #fff;
        text-decoration: none;
        border: solid 1px black;
    }
    .whether-diagnostic:active{
        transform: scale(0.9);
    }
    .ul_patients{
        position: relative;
        top: 30px;
    }
</style>
<link href="/static/script/bootstrap_3.3.0/css/modal.css" type="text/css" rel="stylesheet"/>
<link rel="stylesheet" href="https://www.58html.com/gui/css/font-awesome/css/font-awesome.css">

<div id="lyrow">
    <div class="div_total">
        <div class="div_top">
            <div class="div_btn">
                <div class="div_user">
                    <span class="user" th:text="${doctor.getDoctorName()}"></span>
                    <a href="/changePassword">修改密码</a>
                    <a href="/logout">退出登录</a>
                    <a href="/changeAccount">更改账户</a>
                </div>
                <input type="button" name="button" value="门诊诊断" id="btn_diagnosis" class="btn_menu">
                <input type="button" name="button" value="门诊处方" id="btn_prescription" class="btn_menu">
                <input type="button" name="button" value="申请单" id="btn_applicationForm" class="btn_menu">
                <input type="button" name="button" value="门诊历史" id="btn_history" class="btn_menu">
            </div>
            <div class="div_img">
                <img src="http://localhost:8080/static/img/图标.png" class="img">
            </div>
        </div>
        <div class="div_main">
            <div class="div_main_left">
                <h1 class="tittle">病人列表</h1>
                <div class="patient_list">
                    <div class="whether_diagnosis_done">
                        <input type="button" class="whether-diagnostic" id="diagnosis_done" value="已诊">
                        <input type="button" class="whether-diagnostic" id="no_diagnosis_done" value="未诊">
                    </div>
                    <ul class="ul_patients">
                    </ul>
                </div>
                <input type="text" name="search_name" id="search_name" value="">
                <input type="button" id="search_name_btn" value="查询"/>
            </div>
            <div class="div_main_right">
                <div class="patient_information">
                    <span class="patient_information_a">患者姓名:</span>
                    <span class="patient_information_a" id="span_patient_name" style="color: #0016ff"></span>
                    <span class="patient_information_a" style="left: 10px">年龄:</span>
                    <span class="patient_information_a" id="span_age" style="left: 10px;color: #0016ff"></span>
                    <span class="patient_information_a" style="left: 20px">性别:</span>
                    <span class="patient_information_a" id="span_sexy" style="left: 20px;color: #0016ff"></span>
                    <input type="button" value="打印" id="btn_print" class="patient_information_a"/>
                </div>
                <h2 class="history-title" style="text-align: center;position:absolute;top: -7px;left: 610px">历史诊断</h2>
                <div class="medicalRecord-dateTime">
                    <ul class="ul_medicalRecord-dateTime">
                    </ul>
                </div>
                <div class="medicalRecord-content">
                    <div class="form_a">
                        <div class="div_name">
                            <span class="txt_name">姓名:</span>
                            <input type="text" name="input" class="name" placeholder="请输入姓名" value="" readonly>
                        </div>
                        <div class="div_age">
                            <span class="txt_age">年龄:</span>
                            <input type="text" name="input" class="age" value="" placeholder="请输入年龄" readonly>
                        </div>
                        <div class="div_sexy">
                            <span class="txt_sexy">性别:</span>
                            <select name="select" class="sexy">
                                <option value="1">男</option>
                                <option value="0">女</option>
                            </select></div>
                        <div class="div_symptom">
                            <span class="txt_symptom">症状:</span>
                            <textarea name="textarea" class="symptom" placeholder="请输入症状" readonly></textarea>
                        </div>
                        <div class="div_diagnose">
                            <span class="txt_diagnosis">诊断:</span>
                            <textarea name="textarea" class="diagnosis" placeholder="请输入诊断" readonly></textarea>
                        </div>
                        <div class="div_treat">
                            <span class="txt_treat">治疗:</span>
                            <textarea name="textarea" class="treat" placeholder="请输入治疗方案" readonly></textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="print-view" style="position:absolute;width:0px;height:0px;left:-500px;top:-500px;">
    <div class="container">
        <div class="header">
            <img src="/static/img/图标.png" class="img">
            <h2 style="position: absolute;top: 130px;">病人病历</h2>
            <h3 style="top: 160px;position: absolute">------------------------------------------------------------------------------------------------------------------</h3>
        </div>

        <div class="section" style="margin-top: 50px">

            <h2>患者信息</h2>
            <table class="table" id="tb_patientInformation">
                <tr>
                    <th>姓名</th>
                    <td id="td_patient_name"></td>
                </tr>
                <tr>
                    <th>性别</th>
                    <td id="td_sexy"></td>
                </tr>
                <tr>
                    <th>年龄</th>
                    <td id="td_age"></td>
                </tr>

                <tr>
                    <th>就诊日期</th>
                    <td id="td_date"></td>
                </tr>
                <tr>
                    <th>医生</th>
                    <td id="td_doctor_name" th:text="${doctor.getDoctorName()}"></td>
                </tr>
                <tr>
                    <th>科室</th>
                     <td id="td_department" th:text="${doctor.getDoctorDepartment()}"></td>
                </tr>
            </table>
        </div>
        <div class="section">
            <h2>病历信息</h2>
            <table class="table" id="tb_medicalInformation">
                <tr>
                    <th>症状</th>
                    <td id="td_symptoms"></td>
                </tr>
                <tr>
                    <th>诊断</th>
                    <td id="td_diagnosis"></td>
                </tr>
                <tr>
                    <th>治疗</th>
                    <td id="td_treat"></td>
                </tr>
            </table>
        </div>
    </div>
    <footer style="text-align: center;position: relative;top: 200px">
        <p>版权所有 © xdy 打印预览示例</p>
        <h3 style="position: relative">------------------------------------------------------------------------------------------------------------------</h3>
    </footer>
</div>
</body>
<script src="/static/script/jquery-1.11.1-min.js"></script>
<script src="/static/script/bootstrap_3.3.0/js/bootstrap.min.js"></script>
<script type="text/javascript">
    $(function (){
        $("#btn_diagnosis").css({color:"#000000"})
        $("#btn_prescription").css({color:"#000000"})
        $("#btn_applicationForm").css({color:"#000000"})
        $("#btn_history").css({color:"#f1f1f1"})
    })
    var medical_record_id="";
    var patient_id = "";
    /**
     * 状态变量，在查询病人时判断当前处于是否完成诊断的列表下 false:处于为诊断; true:处于已经诊断下
     * @type {boolean}
     */
    var whether_diagnosis_flag=true;
    //给门诊诊断按钮添加单击事件
    $("#btn_diagnosis").click(function () {
        window.location.href = "/main/index";
    })
    //门诊处方按钮
    $("#btn_prescription").click(function () {
        window.location.href = "/prescription/index";
    })
    //给申请单添加单击事件
    $("#btn_applicationForm").click(function () {
        window.location.href = "/applicationForm/index";
    })

    //加载已经诊断病人列表
    function list_diagnosis_done_patients(){
        $.ajax({
            url:'/main/diagnosis_done_patient_list',
            type:'post',
            dataType:'json',
            success:function (data){
                var html="";
                $.each(data.patients,function (index,obj){
                    html+="<li value=\""+obj.patientId+"\"onclick='getPatientHistoricalMedicalRecord($(this))'>"+obj.patientName+"</li>"
                });
                $(".ul_patients").html(html);
            }
        })
    }
    //加载未诊断病人列表
    function list_no_diagnosis_done_patients(){
        $.ajax({
            url:'/main/no_diagnosis_done_patient_list',
            type:'post',
            dataType:'json',
            success:function (data){
                var html="";
                $.each(data.patients,function (index,obj){
                    html+="<li value=\""+obj.patientId+"\"onclick='getPatientHistoricalMedicalRecord($(this))'>"+obj.patientName+"</li>"
                });
                $(".ul_patients").html(html);
            }
        })
    }
    //给未诊添加单击事件
    $("#no_diagnosis_done").click(function (){
        whether_diagnosis_flag=false;
        list_no_diagnosis_done_patients();
    })
    //给已诊添加单击事件
    $("#diagnosis_done").click(function (){
        whether_diagnosis_flag=true;
        list_diagnosis_done_patients();
    })

    //单机获得病人的历史病历列表（按时间排序）
    function getPatientHistoricalMedicalRecord(obj) {
        medical_record_id="";
        patient_id = $(obj).val();
        $("li").css({background: "#f1f1f1"});
        $(obj).css({background: "#a3a8b6",width:"60px",borderRadius:"5px"})
        $.ajax({
            url: '/history/medicalRecordsDateLists',
            data: {
                patient_id: patient_id
            },
            dataType: 'json',
            type: 'post',
            success: function (data) {
                if(data.code=="1"){
                    var html="";
                    $(".ul_medicalRecord-dateTime").html(html);
                    $("#span_patient_name").text(data.patient.patientName);
                    $("#span_age").text(data.patient.patientAge);
                    $("#span_sexy").text(data.patient.patientSex)
                    $(".symptom").text("");
                    $(".treat").text("");
                    $(".diagnosis").text("");
                    $(".name").val("");
                    $(".age").val("");
                    $(".sexy option[value='1']").attr("selected",true);
                    $(".sexy option[value='0']").removeAttr("selected");
                    if(data.medicalRecordDateDtos==""){
                        alert("该病人还未诊断，无病历");
                    }else{
                        $.each(data.medicalRecordDateDtos,function (index,obj){
                            html+="<li value=\"" + obj.medicalRecordId + "\"onclick='getPatientMedicalRecord($(this))'>" + obj.medicalRecordDate + "</li>"
                        })
                        $(".ul_medicalRecord-dateTime").html(html);
                        $("#span_patient_name").text(data.patient.patientName);
                        $("#span_age").text(data.patient.patientAge);
                        $("#span_sexy").text(data.patient.patientSex)
                    }
                }else {
                    alert(data.msg);
                }
            }
        })
    }
    //获得病历信息
    function getPatientMedicalRecord(obj){
        medical_record_id=$(obj).val();
        $(".ul_medicalRecord-dateTime li").css({background: "#f1f1f1"});
        $(obj).css({background: "#a3a8b6",borderRadius:"5px"})
        $.ajax({
            url:'/history/showMedicalRecord',
            data:{
                medical_record_id:medical_record_id
            },
            dataType:'json',
            type:'post',
            success:function (data){
                if(data.code=="1"){
                    $(".symptom").text(data.symptom);
                    $(".treat").text(data.treat);
                    $(".diagnosis").text(data.diagnosis);
                    $(".name").val(data.patient.patientName);
                    $(".age").val(data.patient.patientAge);
                    if(data.patient.patientSex=="男"){
                        $(".sexy option[value='1']").attr("selected",true);
                        $(".sexy option[value='0']").removeAttr("selected");
                    }else{
                        $(".sexy option[value='0']").attr("selected",true);
                        $(".sexy option[value='1']").removeAttr("selected");
                    }
                }else{
                    alert(data.msg)
                }
            }
        })
    }
    //给查询按钮添加单击事件
    $("#search_name_btn").click(function (){
        var search_name=$("#search_name").val();
        $.ajax({
            url:'/main/queryBySearchName',
            data:{
                search_name:search_name,
                whether_diagnosis_flag:whether_diagnosis_flag
            },
            dataType:'json',
            type:'post',
            success:function (data){
                var html="";
                $.each(data.patients,function (index,obj){
                    html+="<li value=\""+obj.patientId+"\"onclick='getPatientHistoricalMedicalRecord($(this))'>"+obj.patientName+"</li>"
                });
                $(".ul_patients").html(html);
            }
        })
    })
    //查询框enter事件
    $("#search_name").keyup(function (event){
        if(event.keyCode===13){
            $("#search_name_btn").trigger("click");
        }
    })
    //打印
    $("#btn_print").click(function (){
        if(patient_id==""){
            alert("请选择病人");
        }else if(medical_record_id==""){
            alert("请选择一条记录")
        }else{
            $.ajax({
                url:'/history/showMedicalRecord',
                data:{
                    medical_record_id:medical_record_id
                },
                dataType:'json',
                type:'post',
                success:function (data){
                    if(data.code=="1"){
                        $(".print-preview").text("");
                        $("#td_patient_name").text(data.patient.patientName);
                        $("#td_age").text(data.patient.patientAge);
                        $("#td_sexy").text(data.patient.patientSex);
                        $("#td_date").text(data.date);
                        $("#td_symptoms").text(data.symptom);
                        $("#td_diagnosis").text(data.diagnosis);
                        $("#td_treat").text(data.treat);

                        var iframe=document.getElementById("print-iframe");
                        if(iframe==null){
                            var html=$(".print-view").html();
                            iframe = document.createElement('IFRAME');
                            var doc = null;
                            iframe.setAttribute("id", "print-iframe");
                            iframe.setAttribute('style', 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;');
                            document.body.appendChild(iframe);
                            doc=iframe.contentWindow.document;
                            doc.write("<link href=\"/static/script/bootstrap_3.3.0/css/print_preview.css\" type=\"text/css\" rel=\"stylesheet\" />")
                            doc.write("<div>"+html+"</div>")
                            doc.close();
                            iframe.contentWindow.focus();
                        }
                        setTimeout(function(){ iframe.contentWindow.print();},50)
                        setTimeout(()=>{
                            document.body.removeChild(iframe);
                        },2000);
                    }else{
                        alert(data.msg)
                    }
                }
            })
        }
    })
</script>
</html>